package com.learn.eduuserboot.mapper;
import afu.org.checkerframework.checker.igj.qual.I;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.learn.eduapi.entity.user.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface UserMapper extends BaseMapper<User>{
    @Select("select * from user where phone = #{phone}")
    User selectByPhone(@Param("phone") String phone);
    @Select("select * from user where name = #{name}")
    User selectByName(@Param("name") String name);
    @Insert("insert into user (name,portrait,phone,password,status,is_del,create_time,update_time,salt,weixin) values(#{name},#{portrait},#{phone},#{password},#{status},#{isDel},#{createTime},#{updateTime},#{salt},#{weixin})")
    int insertUser(User user);
    int updateUser(User user);
    List<User> getAllUser(@Param("find")String find,@Param("page")Integer page,@Param("size")Integer size);
}
